<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>
        文件上传和下载
    </title>
</head>
<body>
<h1>文件上传</h1>
<form method="post" action="/upload" enctype="multipart/form-data">
    <input type="file" name="file" />
    <button type="submit">上传</button>
</form>

<h1>文件下载</h1>
<ul>
    <li>
        <a th:href="@{/download/{fileName}(fileName='example.txt')}">下载 example.txt</a>
    </li>
</ul>
<p th:text="${message}"></p>
</body>
</html>